package com.bit.cfdi.web.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.bit.cfdi.web.dao.GiroDAO;
import com.bit.cfdi.web.domain.Giro;
import com.bit.cfdi.web.domain.Negocio;

@Service
public class GiroService {
	
	@Autowired
	private GiroDAO giroDao;

	public void save(Giro giro) throws DataAccessException {
		giroDao.save(giro);		
	}

	public List<Giro> getAll() throws DataAccessException {
		return giroDao.getAll();		
	}

	public Giro getGiroByNegocio(Negocio negocio) throws DataAccessException {		
		return giroDao.getGiroByNegocio(negocio);
	}

	public List<Giro> getGiroDefault() throws DataAccessException {		
		return giroDao.getGiroDefault();
	}

	public Giro getGiroByDescripcion(String descripcion) throws DataAccessException {
		return giroDao.getGiroByDescripcion(descripcion);
	}

}
